<template>
	<view>
		
		<!-- 暂无数据 -->
		<no-data v-if="noteListPage.sum && !noteList.length" />
		
		<!-- 笔记列表 -->
		<list-data :list="noteList" tagTatus :keyTag="key" />
		
	</view>
</template>

<script>
	import noData from './components/no-data'
	import listData from './components/list-data'
	
	// 导入Api
	import { getTagNoteList } from '@/http/api'
	
	export default {
		// 注册组件
		components:{ noData , listData },
		data() {
			return {
				noteList:[],
				key:null
			}
		},
		async onLoad(data) {
			this.key = data.key
			await this.getTagNoteList()
		},
		methods: {
			async getTagNoteList(){
				let res = await getTagNoteList({key:this.key});
				this.noteList = res.data.list
				this.noteListPage = res.data.page
			}
		}
	}
</script>

<style scoped lang="scss">

</style>
